#!/usr/local/bin/python2.5
# -*- coding: utf-8 -*-
import chee
from accost import WSGIApplication
from accost.cli import Command
from accost.middlewares import ExceptionTemplateMiddleware
from werkzeug import DebuggedApplication
origin = application = WSGIApplication(chee)
application = ExceptionTemplateMiddleware(application, '404 NOT FOUND', chee.env, 'except/404.html')

from accost.middlewares import *
application = TimeMiddleware(application)

if chee.debug:
    application = DebuggedApplication(application, evalex=True)
    #application = StormSQLMiddleware(application)
    pass


if __name__ == '__main__':
    command = Command(application)
    command.register_app(origin)
    command.run()
